package com.vito.dcs.asphalt.asphaltData.service.impl;

import java.util.*;
import org.springframework.beans.factory.annotation.*;

import com.vito.dcs.asphalt.asphaltData.model.DataAsphaltBlenderModel;
import com.vito.dcs.asphalt.asphaltData.service.DataAsphaltBlenderService;
import com.alibaba.dubbo.config.annotation.Service;
import com.vito.dcs.asphalt.asphaltData.dao.DataAsphaltBlenderMapper;
import com.vito.base.model.DataGrid;
import com.vito.base.factory.IDFactory;

/**
 * DataAsphaltBlenderService接口实现类
 * @author  fangj E-mail: 
 * @version 0.1.1
 * @date    2019-4-10 18:25:00
 */
@Service
public class DataAsphaltBlenderServiceImpl implements DataAsphaltBlenderService {
	
	@Autowired
	private DataAsphaltBlenderMapper dataasphaltblenderMapper;
	
	@Override
	public int save(DataAsphaltBlenderModel dataasphaltblender){
		return dataasphaltblenderMapper.save(dataasphaltblender);
	}
	@Override
	public DataGrid<DataAsphaltBlenderModel> queryAllByPage(DataAsphaltBlenderModel dataasphaltblender){
		DataGrid<DataAsphaltBlenderModel> dg = new DataGrid<DataAsphaltBlenderModel>();
		dg.setRows(dataasphaltblenderMapper.queryAllByPage(dataasphaltblender));
		dg.setTotal(dataasphaltblender.getTotal());
		return dg;
	}
	@Override
	public DataAsphaltBlenderModel query(DataAsphaltBlenderModel dataasphaltblender){
		return dataasphaltblenderMapper.query(dataasphaltblender);
	}
	@Override
	public Integer update(DataAsphaltBlenderModel dataasphaltblender){
		return dataasphaltblenderMapper.update(dataasphaltblender);
	}
	
	@Override
	public Integer delete(DataAsphaltBlenderModel dataasphaltblender){
		return dataasphaltblenderMapper.delete(dataasphaltblender);
	}

    @Override
	public int saveDataAsphaltBlender(DataAsphaltBlenderModel dataasphaltblender){
	    dataasphaltblender.setId(IDFactory.getIDFactory().getIdInc()+"");                                                            
		return save(dataasphaltblender);
	}
}